{extend name="public/base"}

{block name="x-body"}
<style>
    .layui-form .layui-input-inline {
        width: 320px;
    }

    #test9 {
        display: none;
    }

    #demo1{
        width: 200px;
    }
</style>
<div class="x-body">
    <form class="layui-form">
        {if $id}
         <input type="hidden" name="id" value="{$res.id}">
        {/if}

        <div class="layui-form-item">
            <label for="name" class="layui-form-label">
                <span class="x-red">*</span>导航名称
            </label>
            <div class="layui-input-inline">
                <input type="text" id="name" name="name" value="{$res.name}" required="" lay-verify="required"
                       autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label for="url" class="layui-form-label">
                <span class="x-red">*</span>导航链接
            </label>
            <div class="layui-input-inline">
                <input type="text" id="url" name="url" value="{$res.url}" required="" lay-verify="required"
                       autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">
            </label>
            <button  class="layui-btn" lay-filter="add" lay-submit="">
                {$id ? '修改' : '增加'}
            </button>
        </div>
    </form>
</div>
<script>
    formData('{:url("MallConfig/navigation_form")}', 'add', function (){
        parent.location.reload();
        // 获得frame索引
        var index = parent.layer.getFrameIndex(window.name);
        //关闭当前frame
        parent.layer.close(index);
    }, false);
</script>
{/block}